<?php
ob_start();
session_start();

$_SESSION['per']=1;
/*
if(!isset($_SESSION['username'])){
$_SESSION['per']=3;
}else
if(isset($_SESSION['username']) && $_SESSION['username']!='administrator'){
$_SESSION['per']=2;
}else{
$_SESSION['per']=1;
}
if(isset($_SESSION['level'])){
  if($_SESSION['level']!=1){
  //  redirect(HOME);
  }
}
*/

$baseurl="../";
require("libraries/function.php");
require("libraries/config.php");
require("libraries/dbclass2.php");
require("libraries/db_record2.php");
require("libraries/cache.php");


require ('public/xcrud/xcrud2/xcrud/xcrud.php');



if(isset($_GET['module']))
{	$mod=$_GET['module'];
	switch($mod)
		{
		case "user":require("controllers/user/controller.php");
		break;
		case "news":require("controllers/news/controller.php");
		break;
		case "comment":require("controllers/comment/controller.php");
		break;
		case "scash":require("controllers/scash/controller.php");
		break;
		}
		exit();
}else
if(isset($_POST['module']))
{	$mod=$_POST['module'];
	switch($mod)
		{
		case "user":require("controllers/user/controller.php");
		break;
		case "news":require("controllers/news/controller.php");
		break;
		case "comment":require("controllers/comment/controller.php");
		break;
		case "bluesea":require("controllers/bluesea/controller.php");
		break;
		}
}
else
{
	$data1[title]="WebSite Admin Area";
	loadview('template/header',$data1);
	loadview('template/right');
	loadview('template/footer');
}
ob_end_flush();
?>